#include "stdafx.h"
#include <osg/MatrixTransform>
int UCMatrixTransform()
{

	Group* root=new Group();
	Node* cowNode=osgDB::readNodeFile("cow.osg");
	MatrixTransform* mt1=new MatrixTransform();
	Matrix mtx;
	mtx.makeTranslate(Vec3d(10.0f,0.0f,0.0f));
	mtx.makeRotate(45.0f,1.0f,0.0f,0.0f);
	mt1->setMatrix(mtx);
	mt1->addChild (cowNode);

	Matrix mtx2;
	mtx2.makeTranslate(Vec3d(-10.0f,0.f,0.f));
	MatrixTransform* mt2=new MatrixTransform();
	mt2->setMatrix(mtx2);
	mt2->addChild(cowNode);

	root->addChild(mt1);
	root->addChild(mt2);
	Viewer* scene=new Viewer();
	scene->setSceneData(root);
	scene->realize();
	scene->run();
	return 0;
}